<template>
  <div class="yd-director">
    <div class="dir-prev">
      <a href="javascript:void(0)" @click="dirClick('prev')">&lt;</a>
    </div>
    <div class="dir-next">
      <a href="javascript:void(0)" @click="dirClick('next')">&gt;</a>
    </div>
  </div>
</template>

<script>
export default {
  name: "director",
  setup(props, ctx) {
    const dirClick = dir => {
      ctx.emit("dirClick", dir);
    };
    return {
      dirClick
    };
  }
};
</script>

<style lang="scss" scoped>
.yd-director {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  .dir-prev,
  .dir-next {
    position: absolute;
    top: 50%;
    margin-top: -20px;
    color: #fff;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    z-index: 1;
    & > a {
      display: block;
      width: 40px;
      height: 40px;
      line-height: 40px;
      text-align: center;
      color: #fff;
      border-radius: 50%;
      text-decoration: none;
      font-weight: bold;
    }
    & > a:hover {
      text-decoration: none;
    }
  }
  .dir-prev {
    left: 10px;
  }
  .dir-next {
    right: 10px;
  }
  .dir-prev:hover {
    background-color: rgba(0, 0, 0, 0.4);
  }
  .dir-next:hover {
    background-color: rgba(0, 0, 0, 0.4);
  }
}
</style>